home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / tabkeyboardshortcutswidget.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-19  |  3.4 KB  |  88 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8. *   Copyright (C) 2006 by Craig Bradney                                   *
  9. *   cbradney@zip.com.au                                                   *
  10. *                                                                         *
  11. *   This program is free software; you can redistribute it and/or modify  *
  12. *   it under the terms of the GNU General Public License as published by  *
  13. *   the Free Software Foundation; either version 2 of the License, or     *
  14. *   (at your option) any later version.                                   *
  15. *                                                                         *
  16. *   This program is distributed in the hope that it will be useful,       *
  17. *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  18. *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  19. *   GNU General Public License for more details.                          *
  20. *                                                                         *
  21. *   You should have received a copy of the GNU General Public License     *
  22. *   along with this program; if not, write to the                         *
  23. *   Free Software Foundation, Inc.,                                       *
  24. *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  25. ***************************************************************************/
  26. #ifndef TABKEYBOARDSHORTCUTSWIDGET_H
  27. #define TABKEYBOARDSHORTCUTSWIDGET_H
  28.  
  29. #include "ui_tabkeyboardshortcutswidget.h"
  30. #include "scribusapi.h"
  31. #include "scribusstructs.h"
  32.  
  33. #include <QMap>
  34. #include <QPair>
  35. #include <QString>
  36. #include <QStringList>
  37. #include <QKeyEvent>
  38. #include <QEvent>
  39.  
  40. // FIXME: shortcut tree list is a clear candidate for Qt4 MVC (Proxy model with Treemodel)
  41. class TabKeyboardShortcutsWidget: public QWidget, Ui::TabKeyboardShortcutsWidget
  42. {
  43.     Q_OBJECT
  44.     public:
  45.         TabKeyboardShortcutsWidget(QMap<QString, Keys> oldKeyMap, QWidget *parent = 0, const char *name = 0);
  46.         const QMap<QString, Keys> getNewKeyMap();
  47.         static QString getKeyText(int KeyC);
  48.         bool event( QEvent* ev );
  49.         void keyPressEvent(QKeyEvent *k);
  50.         void keyReleaseEvent(QKeyEvent *k);
  51.         void restoreDefaults();
  52.         
  53.     protected:
  54.         QMap<QString,Keys> keyMap;
  55.         QMap<QString,Keys>::Iterator currentKeyMapRow;
  56.         QMap<QString, QString> keySetList;
  57.         QMap<QTreeWidgetItem*, QString> lviToActionMap;
  58.         QList<QTreeWidgetItem*> lviToMenuMap;
  59.         QVector< QPair<QString, QStringList> >* defMenus;
  60.         QVector< QPair<QString, QStringList> >* defNonMenuActions;
  61.         QTreeWidgetItem * selectedLVI;
  62.         int keyCode;
  63.         QString Part0;
  64.         QString Part1;
  65.         QString Part2;
  66.         QString Part3;
  67.         QString Part4;
  68.     
  69.         void insertActions();
  70.         void importKeySet(QString);
  71.         bool exportKeySet(QString);
  72.         QStringList scanForSets();
  73.         bool checkKey(int Code);
  74.     
  75.     protected slots:
  76.         void setKeyText();
  77.         void dispKey(QTreeWidgetItem* current, QTreeWidgetItem* previous=0);
  78.         void setNoKey();
  79.         void loadKeySetFile();
  80.         void importKeySetFile();
  81.         void exportKeySetFile();
  82.         void resetKeySet();
  83.         void clearSearchString();
  84.         void applySearch( const QString & newss );
  85. };
  86.  
  87. #endif
  88.